﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OkTool.Crypto
{
    public class SignUtil
    {
        public static string Sign(Dictionary<string, string> param, string key)
        {
            var str = string.Empty;
            var newParamDic = param.Reverse();
            foreach (var item in newParamDic)
            {
                str += item.Key + "=" + item.Value + "&";
            }
            str += "key=" + key;

            return "";
        }
        public static bool Check(Dictionary<string, string> param, string key, string sign)
        {
            var signStr = Sign(param, key);
            return signStr.ToLower() == sign.ToLower();
        }
    }
}
